class MyQueue {
public:
stack<int> Ins;
stack<int> Outs;
    MyQueue() {

    }
    
    void push(int x) {
Ins.push(x);
    }
    
    int pop() {
        int t;
if(Outs.empty()) {
            while(!Ins.empty()) {
                Outs.push(Ins.top());
                Ins.pop();
            }
        }
        t= Outs.top();
        Outs.pop();
        return t;
    }
    
    int peek() {
        int a; 
        a= this->pop(); 
        Outs.push(a); 
        return a;
    }
    
    bool empty() {
return Ins.empty()&&Outs.empty();
    }
};